<%@ Page Language="VB" AutoEventWireup="false" CodeFile="BudgetCategoryHeadings.aspx.vb" MasterPageFile="~/Admin/Admin.master" Inherits="admin_BudgetCategoryHeadings" Title="Admin - Spending Plan Column Headings" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>
<%@ Register Src="SubNavControls/BudgetSubNavControl.ascx" TagName="BudgetSubNavControl" TagPrefix="uc1" %>

 <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
<uc1:BudgetSubNavControl ID="SubNavCtrl" runat="server" />
        <asp:ObjectDataSource ID="CatHeadingsObjectDataSource" runat="server"
            InsertMethod="SaveInstance" SelectMethod="ListBySort"
            TypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategoryHeader" DataObjectTypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategoryHeader"
            UpdateMethod="UpdateInstance" SortParameterName="sortExpr" >
            <SelectParameters>
                <asp:ControlParameter ControlID="AdminBudgetCategoriesDropDownList" DefaultValue="0" Name="categoryId" PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        
        <asp:ObjectDataSource ID="NewCatHeadingsObjectDataSource" runat="server" DataObjectTypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategoryHeader"
            InsertMethod="SaveInstance" TypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategoryHeader" SelectMethod="getNew">
        </asp:ObjectDataSource>
        
        <asp:ObjectDataSource ID="AdminBudgetCategoriesObjectDataSource" runat="server" SelectMethod="ListAll"
            TypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategory" DataObjectTypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategory" ConvertNullToDBNull="True"></asp:ObjectDataSource>
    



    <table cellpadding="0" cellspacing="0">
<tr><td style="width:20px;" rowspan="6"></td>
<td><h1><a id="pagecontent">Admin - Spending Plan Column Headings</a></h1></td>
    <td align="right"><asp:Label ID="CategoryLabel" runat="server" AssociatedControlID="AdminBudgetCategoriesDropDownList" Text="Category:" CssClass="adminSelectLabel"></asp:Label>
        <asp:DropDownList ID="AdminBudgetCategoriesDropDownList" runat="server" CssClass="adminSelectForm" AutoPostBack="False"
            DataSourceID="AdminBudgetCategoriesObjectDataSource" DataTextField="DisplayName" DataValueField="BudgetCategoryId" style="border-left-color:#6B696B; border-bottom-color: #6B696B; border-top-style: solid; border-top-color: #6B696B; border-right-style: solid; border-left-style: solid; border-right-color: maroon; border-bottom-style: solid">
        </asp:DropDownList>
        <asp:Button ID="SubmitCategory" runat="server" Text="Go" /></td></tr>
    <tr><td colspan="2" align="center">
             <cc2:ScrollingGridView ID="CategoryHeadingsScrollingGridView" IsFixedColumn="true" runat="server" CssClass="gridOffsetSmall" HorizontalAlign="center" CellPadding="5" ToolTip="190"
            AutoGenerateColumns="False" DataSourceID="CatHeadingsObjectDataSource" DataKeyNames="Id" BorderColor="#21334B" BorderStyle="Solid" GridLines="Vertical" EmptyDataText="No data.  Click <b>Add</b> button below to add an item." AllowSorting="true">
        <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" />
            <Columns>
                <asp:TemplateField HeaderText="Column Heading" SortExpression="DisplayName" HeaderStyle-Wrap="true">
                    <ItemStyle Width="180px" />
                    <HeaderStyle Width="185px" />
                    <ItemTemplate><%# Eval("DisplayName") %></ItemTemplate>
                    <EditItemTemplate>
                        <table cellspacing="0" cellpadding="0">
                        <tr><td><asp:TextBox ID="DisplayTextBox" cssClass="adminColumnStyle" runat="server" MaxLength="30"  Text='<%# Bind("DisplayName") %>'  Columns="30"  ToolTip="Edit Display Name"></asp:TextBox></td></tr>
                        <tr><td><cc2:ValidationErrorSummary ID="EditErrorSummary" runat="server" Message="" Visible="false" Width="300" /></td></tr>
                        </table>             
                    </EditItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="Show On Spending Plan?" SortExpression="DisplayOnSpendingPlan" >
               <ItemStyle HorizontalAlign="center" Width="60px" />
               <HeaderStyle Width="60px" />
                <ItemTemplate>
                <asp:Image ID="ShowOnSpendingPlanImage" runat="server" ImageUrl="~/images/blankcheck.gif" />
                </ItemTemplate>
                <EditItemTemplate>
                <asp:CheckBox ID="ShowOnSpendingPlanCheckBox" runat="server" Enabled='<%#Eval("DisplayFieldsEditable") %>' Checked='<%#Eval("DisplayOnSpendingPlan") %>' />
                </EditItemTemplate>
        </asp:TemplateField>
         <asp:TemplateField HeaderText="Show On Exp. Report?" SortExpression="DisplayOnExpenditureReport" HeaderStyle-Wrap="true">
               <ItemStyle HorizontalAlign="center" Width="60px" />
               <HeaderStyle Width="60px" />
                <ItemTemplate>
                <asp:Image ID="ShowOnMonthlyStatementImage" runat="server" ImageUrl="~/images/blankcheck.gif" />
                </ItemTemplate>
                <EditItemTemplate>
                <asp:CheckBox ID="ShowOnMonthlyStatementCheckBox" runat="server" Enabled='<%#Eval("DisplayFieldsEditable") %>' Checked='<%#Eval("DisplayOnExpenditureReport") %>' />
                </EditItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Online Column Width" SortExpression="ColumnWidth" HeaderStyle-Wrap="true">
        <ItemStyle HorizontalAlign="Center" Width="55px" />
        <HeaderStyle Width="55px" />
        <ItemTemplate><%#Eval("ColumnWidth")%></ItemTemplate>
        <EditItemTemplate>
             <asp:TextBox ID="ColumnWidthTextBox" CssClass="adminColumnStyle" Columns="3" Width="30" MaxLength="3" runat="server" Text='<%# Bind("ColumnWidth") %>' ToolTip="Set the Width of the Textboxes when editing online"></asp:TextBox>
        </EditItemTemplate>
        </asp:TemplateField>
                <asp:TemplateField HeaderText= "Display Order (Left to Right)" SortExpression="DisplayOrder" HeaderStyle-Wrap="true">
                <ItemStyle HorizontalAlign="Center" Width="60px" />
                <HeaderStyle Width="60px" />
                <ItemTemplate><%# Eval("DisplayOrder") %></ItemTemplate>
                <EditItemTemplate>
                        <asp:TextBox ID="DisplayOrderTextBox" CssClass="adminColumnStyle" Columns="3" Width="30" MaxLength="3" runat="server" Text='<%# Bind("DisplayOrder") %>' ToolTip="Edit Display Order"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText= "Column Span" SortExpression="ColumnSpan" ItemStyle-HorizontalAlign="center">
                <ItemStyle HorizontalAlign="Center" Width="50px" />
                <HeaderStyle Width="50px" />
                 <ItemTemplate><%# Eval("ColumnSpan") %></ItemTemplate>
                <EditItemTemplate>
                        <asp:TextBox ID="ColumnSpanTextBox" Columns="3" MaxLength="3" Width="30" CssClass="adminColumnStyle" runat="server" Text='<%# Bind("ColumnSpan") %>' ToolTip="Edit Column Span"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Format">
                     <ItemStyle Width="65px" />
                     <HeaderStyle Width="65px" />
                    <ItemTemplate><%# Eval("ItemFormat") %></ItemTemplate>
                    <EditItemTemplate>
                        <asp:DropDownList ID="EditItemFormatDropDownList" runat="server">
                            <asp:ListItem Text="..." Value=""></asp:ListItem>
                            <asp:ListItem Text="currency" Value="currency"></asp:ListItem>
                            <asp:ListItem Text="date" Value="date"></asp:ListItem>
                            <asp:ListItem Text="decimal" Value="decimal"></asp:ListItem>
                            <asp:ListItem Text="integer" Value="integer"></asp:ListItem>
                            <asp:ListItem Text="text" Value="text"></asp:ListItem>
                        </asp:DropDownList>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Formula">
                 <ItemStyle Width="205px" />
                 <HeaderStyle Width="205px" />
                 <ItemTemplate><%#Eval("Formula")%></ItemTemplate>
                 <EditItemTemplate>
                 <table cellpadding="0" cellspacing="0"><tr><td>
                 <asp:TextBox ID="FormulaTextBox" Width="200px" TextMode="MultiLine" Rows="3" Columns="30" CssClass="adminColumnStyle" runat="server" Text='<%# Bind("Formula") %>' ToolTip="Edit Formula"></asp:TextBox>
                </td></tr>
                <tr><td>
                Expenditure Report Formula<br /> 
                (if different from Spending Formula)<br />
                Enter <b>[None]</b> for no formula )
                </td></tr>
                <tr><td>
                <asp:TextBox ID="ExpenditureReportFormulaTextBox" Width="200px" TextMode="MultiLine" Rows="3" Columns="30" CssClass="adminColumnStyle" runat="server" Text='<%# Bind("ExpenditureReportFormula") %>' ToolTip="Edit Expenditure Report Formula, if different than spending plan formula."></asp:TextBox>
                 </td></tr></table>
                 </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" HeaderText="Action" AccessibleHeaderText="Action" HeaderStyle-Wrap="True">
                    <ItemStyle HorizontalAlign="Center" Wrap="true" Width="65px" />
                    <HeaderStyle Width="95px" />
                </asp:CommandField>
            </Columns>
        <AlternatingRowStyle BackColor="#E8ECF4" />
        <EmptyDataRowStyle CssClass="headerStyle" BackColor="#C3CAD4" /></cc2:ScrollingGridView>
             
    </td></tr>
    <tr><td colspan="2">
        <cc2:ValidationErrorSummary ID="ErrorSummary" runat="server" Message="" Visible="false" />
    </td></tr>
    <tr><td colspan="2">
    <asp:DetailsView ID="AdminBudgetCategoriesDetailsView" runat="server" CssClass="gridOffset" Width="825px" DataSourceID="NewCatHeadingsObjectDataSource" DefaultMode="insert" AutoGenerateRows="False"  GridLines="none" Visible="false">
                <Fields>
                    <asp:TemplateField HeaderStyle-CssClass="adminLabel">
                        <InsertItemTemplate>
                            <table border="0" cellpadding="3" cellspacing="0">
                                <tr>
                                    <td align="right"><asp:Label ID="DisplayNameDetailsLabel" AssociatedControlID="DisplayNameDetailsTextBox" runat="server" CssClass="adminLabel" Text="Display Name:"></asp:Label></td>
                                    <td><asp:TextBox ID="DisplayNameDetailsTextBox" CssClass="text" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="right"><asp:Label ID="DisplayOrderDetailsLabel" AssociatedControlID="DisplayOrderDetailsTextBox" runat="server" CssClass="adminLabel" Text="Display Order:"></asp:Label></td>
                                    <td><asp:TextBox ID="DisplayOrderDetailsTextBox" CssClass="text" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="right"><asp:Label ID="ColumnSpanDetailsLabel" AssociatedControlID="ColumnSpanDetailsTextBox" runat="server" CssClass="adminLabel" Text="Column Span:"></asp:Label></td>
                                    <td><asp:TextBox ID="ColumnSpanDetailsTextBox" CssClass="text" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td align="right"><asp:Label ID="IsActiveDetailsLabel" AssociatedControlID="IsActiveDetailsCheckBox" runat="server" CssClass="adminLabel" Text="Is Active:"></asp:Label></td>
                                    <td><asp:CheckBox ID="IsActiveDetailsCheckBox" CssClass="formRadio" runat="server" /></td>
                                </tr>
                            </table>
                        </InsertItemTemplate>
                    </asp:TemplateField>
                </Fields>
            </asp:DetailsView>
    </td></tr>
    <tr><td colspan="2">
    <asp:Button ID="AddButton" runat="server" Text="Add" Visible="false"/>
    </td></tr>
    <tr><td colspan="2">
            <asp:Button ID="SubmitButton" runat="server" Text="Submit" Visible="false" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" Visible="false" />
    </td></tr>
    </table>
</asp:Content>
